refactor: use typed Prometheus family descriptors#14
Draft
zeitlinger wants to merge 1 commit into
Draft
Conversation
Signed-off-by: Gregor Zeitlinger <gregor.zeitlinger@grafana.com>
e7e6132 to
725928c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Blocked by open-telemetry#8346
Summary
Stacked on top of open-telemetry#8346.
This refactors the Prometheus exporter to use the new typed
client_javafamily descriptor API where the translation strategy already matches typed
Prometheus family semantics.
Depends on:
What changed
MetricFamilyDescriptorfortarget_infoMetricFamilyDescriptorwhen deriving metadata for:UNDERSCORE_ESCAPING_WITH_SUFFIXESNO_UTF8_ESCAPING_WITH_SUFFIXESMetricMetadataconstruction paths for theno-suffix translation modes for now
metadata shape for UTF-8 counter translation
Why
#8346expands translation-strategy support, but the exporter still manuallyconstructs Prometheus
MetricMetadatain the conversion path.With
client_java#2114, the Prometheus-semantic translation modes can rely onupstream typed metadata derivation instead of rebuilding those rules locally.
The no-suffix translation modes are intentionally left on the compatibility
path for now because they do not map cleanly to typed counter semantics.
Validation
Tested locally against a locally installed
prometheus/client_java1.6.2-SNAPSHOTcontainingMetricFamilyDescriptorfromprometheus/client_java#2114:Notes
to pass upstream CI before the
client_javaAPI lands in a publisheddependency.